package com.itttq.gen.generator.to;

import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Builder
@Data
public class TableTo implements Comparable<TableTo>, Serializable {
    private static final long serialVersionUID = -962358510375073043L;
    /**
     * 数据表字段
     */
    private List<ColumnTo> columns;
    /**
     * 主键
     */
    private String primaryKey;
    /**
     * 主键类型
     */
    private String primaryKeyJavaType;
    /**
     * 表名
     */
    private String name;
    /**
     * 备注
     */
    private String remark;

    @Override
    public int compareTo(TableTo other) {
        if (other == null) {
            return 1;
        }
        return this.getName().compareTo(other.getName());
    }

}
